<div class="history-versions-container">

  <div class="left">
    <nz-card [nzBordered]="false" nzTitle="档案历史版本">
      <!--<nz-list [nzDataSource]="listData" [nzRenderItem]="defaultItem">
        <ng-template #defaultItem let-item let-i="index">
          <nz-list-item (click)="changePdf(item)" [ngClass]="{'active': item.id === selectedItemId}">
            <div class="item-wrap">
              <div class="xh">{{i+1}}</div>
              <div class="time">{{item.createDate | date:'yyyy/MM/dd HH:mm:ss'}}</div>
            </div>
          </nz-list-item>
        </ng-template>
      </nz-list>-->

      <div class="version-list">
        <ng-container *ngFor="let item of listData;let i=index">
          <div class="item-wrap" (click)="changePdf(item)" [ngClass]="{'active': item.id === selectedItemId}">
            <div class="xh">{{i+1}}</div>
            <div class="time">{{item.createDate | date:'yyyy/MM/dd HH:mm:ss'}}</div>
            <div class="version">V{{item.version}}</div>
            <div class="new" *ngIf="item.isCurrent == 'Y'">
              <img src="assets/images/file/new.png">
            </div>
          </div>
        </ng-container>
      </div>
    </nz-card>

  </div>

  <div class="right">
    <nz-card [nzBordered]="false" nzTitle="PDF文件预览" [nzExtra]="extraTemplate">
      <ngx-extended-pdf-viewer
        [src]="pdfSrc"
        [showPrintButton]="false"
        [showOpenFileButton]="false"
        useBrowserLocale="true" height="calc(100vh - 210px)"
      >
      </ngx-extended-pdf-viewer>
    </nz-card>
    <ng-template #extraTemplate>
      <div class="extra-btns">
        <button nz-button nzType="primary" (click)="downloadPdf()">下载</button>
        <button nz-button nzType="primary" (click)="back()">返回</button>
      </div>

    </ng-template>
  </div>
</div>
